//
//  CWndUI.cpp
//  beast_tamer
//
//  Created by chiawei.tseng on 13/2/7.
//
//

#include "CWndUI.h"


CWndUI* CWndUI::CreateWndUI(const char *spName , const fPoint &point)
{
    CWndUI *ptr = new CWndUI();
    
    if (ptr && ptr->initWithFile(spName) && ptr->init())
    {
        ptr->InitWithData(point);
        ptr->autorelease();
        
        return ptr;
    }
    
    CC_SAFE_DELETE(ptr);
    
    return NULL;
}

CWndUI::CWndUI()
{
    
}

CWndUI::~CWndUI()
{
    
}

void CWndUI::InitWithData(const fPoint &point)
{
    setPosition(ccp(point.X,point.Y));
    
    setAnchorPoint(ccp(0, 0));
}

bool CWndUI::init()
{
    if(!CBaseUI::init())
        return false;
    
    m_UiType = UI_VIEW;
    
    return true;
}